package org.aaa.exp04;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Richard Wang
 * @date 2025/7/3 22:35
 */
@Slf4j(topic = "c.Test01")
public class Test04 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread("t1") {
            @Override
            public void run() {
                try {
                    log.debug("enter sleep");
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    log.debug("wake up");
                    throw new RuntimeException(e);
                }
            }
        };
        t1.start();
        Thread.sleep(1000);
        log.debug("interrupt");
        t1.interrupt();
    }
}
